package com.xinsoft.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;

/**
 * 销售退货明细
 * @TableName scm_sale_return_item
 */
@TableName(value ="scm_sale_return_item")
@Data
public class ScmSaleReturnItem implements Serializable {
    /**
     * 销售退货明细ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 销售出库明细ID
     */
    private Integer outstockItemId;

    /**
     * 销售退货ID
     */
    private Integer saleReturnId;

    /**
     * 库存批次
     */
    private String batch;

    /**
     * 物料ID
     */
    private Integer materialId;

    /**
     * 退货数量
     */
    @Positive(message = "退货数量必须大于0")
    private BigDecimal returnNum;

    /**
     * 仓库ID
     */
    private Integer warehouseId;

    /**
     * 库位ID
     */
    private Integer warehItemId;

    /**
     * 源单主键
     */
    @NotNull(message = "源单id（sourceId）不能为空")
    private Integer sourceId;

    /**
     * 源单类型
     */
    private Integer sourceType;

    /**
     * 销售单价
     */
    private BigDecimal saleUnitPrice;

    /**
     * 销售总价
     */
    private BigDecimal totalPrice;

    /**
     * 备注
     */
    private String remark;

    /**
     * 辅助单位
     */
    private Integer assistUom;

    /**
     * 换算系数
     */
    @Positive(message = "换算系数只能是正数（大于0）")
    private BigDecimal convCoefficient;

    /**
     * 源单编号
     */
    @NotNull(message = "源单编码（sourceCode）不能为空")
    private String sourceCode;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}